package com.xuecheng.base.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author luhao
 * @ClassName PageResult.java
 * @Description 分页查询结果模型类
 * @createTime 2023/5/11
 */
@Data
@ApiModel(description = "分页结果信息")
public class PageResult<T> implements Serializable {
    // 数据列表
    @ApiModelProperty("分页条目")
    private List<T> items;

    //总记录数
    @ApiModelProperty("页码总数")
    private long counts;

    //当前页码
    @ApiModelProperty("当前页码")
    private long page;

    //每页记录数
    @ApiModelProperty("每页条目数")
    private long pageSize;

    public PageResult(List<T> items, long counts, long page, long pageSize) {
        this.items = items;
        this.counts = counts;
        this.page = page;
        this.pageSize = pageSize;
    }
}
